import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'


// 路由懒加载
// import login from '../components/login.vue'
const Head = () => import(/* webpackChunkName: "head" */ '../components/head/Head.vue')

const Course = () => import(/* webpackChunkName: "course" */ '../components/course/Course.vue')

const Note = () => import(/* webpackChunkName: "note" */ '../components/note/Note.vue')

const Rank = () => import(/* webpackChunkName: "rank" */ '../components/rank/Rank.vue')

const UnLogin = () => import(/* webpackChunkName: "unlogin" */ '../components/Unlogin.vue')

Vue.use(VueRouter)

  const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home,
	redirect: '/head'
  },
   { path: '/home',component: Home,redirect: '/head',
  	children: [
  		{ path: '/head',component: Head},
  		{ path: '/course',component:Course },
  		{ path: '/note',component:Note },
  		{ path: '/rank',component: Rank },
		{ path: '/unlogin',component: UnLogin }
  		]
  } 
]

const router = new VueRouter({
  routes
})

export default router
